package com.glacier.cloud.user.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * date 2023-12-16 16:19
 *
 * @author glacier
 * @version 1.0
 */
@RefreshScope
@RestController
@RequestMapping("/config")
public class ConfigController {
    private static final Logger LOGGER = LoggerFactory.getLogger(ConfigController.class);

    @Value("${userServ.test1:}")
    private String test1;

    @Value("${userServ.test2:}")
    private String test2;

    @Value("${userServ.test3:}")
    private String test3;

    @GetMapping("/order")
    public String order() {
        LOGGER.info("配置文件顺序,test1: {}, test2: {} , test3: {}", test1, test2, test3);
        return test1 + "-" + test2 + "-" + test3;
    }
}
